package main.java.chessfootball.model.regulation;

import main.java.chessfootball.model.game.Side;

/**
 * User: Igor
 * Date: 11.06.2011
 * Time: 8:41:23
 */
public class Time
{
	private Integer turns;
	private Integer moves;
	private Period period;
	private Side turnSide;
	private Side startSide;
	private Integer endOfTime;

	public Time(Integer turns, Integer moves, Period period, Side turnSide, Side startSide, Integer endOfTime)
	{
		this.turns = turns;
		this.moves = moves;
		this.period = period;
		this.turnSide = turnSide;
		this.startSide = startSide;
		this.endOfTime = endOfTime;
	}

	public void move()
	{
		moves++;
	}

	public void turn()
	{
		turns++;
		moves = 0;
	}

	public void changeSide()
	{
		turnSide = turnSide.getInvert();
	}

	public void setTurns(Integer turns)
	{
		this.turns = turns;
	}

	public void setMoves(Integer moves)
	{
		this.moves = moves;
	}

	public void setPeriod(Period period)
	{
		this.period = period;
	}

	public void setStartSide(Side startSide)
	{
		this.startSide = startSide;
	}

	public void setTurnSide(Side turnSide)
	{
		this.turnSide = turnSide;
	}

	public Integer getTurns()
	{
		return turns;
	}

	public Integer getMoves()
	{
		return moves;
	}

	public Period getPeriod()
	{
		return period;
	}

	public Side getTurnSide()
	{
		return turnSide;
	}

	public Side getStartSide()
	{
		return startSide;
	}

	public Integer getEndOfTime()
	{
		return endOfTime;
	}
}
